package com.xhs.controller;

import com.xhs.dto.request.SendParams;
import com.xhs.message.ReturnResult;
import com.xhs.service.SkywalkingService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @desc:
 * @projectName: spring-boot-skywalking
 * @author: xhs
 * @date: 2024-06-17 017 13:10
 * @version: JDK 1.8
 */

@RestController
@RequestMapping("/skywalking")
public class SkywalkingController {

    @Resource
    private SkywalkingService skywalkingService;


    /**
     * 测试将日志上报到Skywalking服务
     *
     * @param param 入参
     * @return ReturnResult
     */
    @PostMapping("/send")
    public ReturnResult<Object> send(@RequestBody SendParams param) {
        return skywalkingService.send(param);
    }
}
